package come.tool.map;

public class MaskUnit {

	public int startX;
	public int startY;
	public int width;
	public int height;
	public int maskN;
	public byte[] maskData;
	
	public int getStartX() {
		return startX;
	}
	public void setStartX(int startX) {
		this.startX = startX;
	}
	public int getStartY() {
		return startY;
	}
	public void setStartY(int startY) {
		this.startY = startY;
	}
	public int getWidth() {
		return width;
	}
	public void setWidth(int width) {
		this.width = width;
	}
	public int getHeight() {
		return height;
	}
	public void setHeight(int height) {
		this.height = height;
	}
	public int getMaskN() {
		return maskN;
	}
	public void setMaskN(int maskN) {
		this.maskN = maskN;
	}
	public byte[] getMaskData() {
		return maskData;
	}
	public void setMaskData(byte[] maskData) {
		this.maskData = maskData;
	}
	
	/**
	 * 在坐标库中绘制出一个遮挡矩形
	 * @return
	 */
	public void getMsk(byte[][] msk){
		for (int x = startX/20; x < (startX + width)/20 ; x++) {
			for (int y = startY/20 ; y < (startY + height)/20 ; y++) {
				if (msk[y][x] != 0) {
					msk[y][x] = 2;
				}
			}
		}
	}

	
}
